#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
    pid_t id = fork();
    if (id == 0)
    {
        //child
        int cnt = 5;
        while (cnt)
        {
            printf("i am child, pid: %d, ppid: %d, cnt: %d\n", getpid(), getppid(), cnt);
            cnt--;
            sleep(1);
        }
        exit(0);
    }
    else
    {
       
        //father
        while (1)
        {
            printf("i am father, pid: %d, ppid: %d\n", getpid(), getppid());
            sleep(1);
        }

        //父进程目前并没有针对子进程干任何事事情
    }
}
